<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateWorkOrderGatherTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('work_order_gather', function (Blueprint $table) {
            $table->id();
            $table->string('workOrderNo', 36)->default('')->comment('工单号');
            $table->unsignedInteger('shopId')->default(0)->comment('门店ID');
            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedTinyInteger('isDeleted')->default(0)->comment('是否删除');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment = '工单汇总（冗余工单数据）';

            $table->index('workOrderNo', 'idx_workOrderNo');
            $table->index('shopId', 'idx_shopId');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('work_order_gather');
    }
}
